/*
 * Class8 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
final class Class8 {
	private byte[][][] aByteArrayArrayArray138;
	private byte aByte139 = 0;
	private boolean aBoolean140 = true;
	private static int anInt141 = (int) (Math.random() * 17.0) - 8;
	private byte[][][] aByteArrayArrayArray142;
	private static final int[] anIntArray143 = { 0, -1, 0, 1 };
	private int[] anIntArray144;
	private int[] anIntArray145;
	private int[] anIntArray146;
	private int[] anIntArray147;
	private int[] anIntArray148;
	private int[][][] anIntArrayArrayArray149;
	static int anInt150 = 99;
	private int anInt151;
	private int anInt152;
	private byte[][][] aByteArrayArrayArray153;
	private static byte aByte154 = -80;
	private byte[][][] aByteArrayArrayArray155;
	private byte aByte156 = 0;
	private boolean aBoolean157 = true;
	private static final int[] anIntArray158 = { 1, 2, 4, 8 };
	private byte[][][] aByteArrayArrayArray159;
	private int anInt160 = 20411;
	private static final int[] anIntArray161 = { 1, 0, -1, 0 };
	static int anInt162;
	private static int anInt163 = (int) (Math.random() * 33.0) - 16;
	private byte[][][] aByteArrayArrayArray164;
	private int[][] anIntArrayArray165;
	private int anInt166 = 69;
	private static final int[] anIntArray167 = { 16, 32, 64, 128 };
	private int[][][] anIntArrayArrayArray168;
	static boolean aBoolean169 = true;

	private static final int method163(int i, int i_0_, int i_1_) {
		int i_2_ = i / i_1_;
		int i_3_ = i & i_1_ - 1;
		int i_4_ = i_0_ / i_1_;
		int i_5_ = i_0_ & i_1_ - 1;
		int i_6_ = Class8.method178(i_2_, i_4_);
		int i_7_ = Class8.method178(i_2_ + 1, i_4_);
		int i_8_ = Class8.method178(i_2_, i_4_ + 1);
		int i_9_ = Class8.method178(i_2_ + 1, i_4_ + 1);
		int i_10_ = Class8.method176(i_6_, i_7_, i_3_, i_1_);
		int i_11_ = Class8.method176(i_8_, i_9_, i_3_, i_1_);
		return Class8.method176(i_10_, i_11_, i_5_, i_1_);
	}

	public int method164(int i, int i_12_, int i_13_, byte i_14_) {
		if (i_14_ == aByte156) {
		} else {
			return 2;
		}
		if ((aByteArrayArrayArray138[i_12_][i_13_][i] & 0x8) != 0) {
			return 0;
		}
		if (i_12_ > 0 && (aByteArrayArrayArray138[1][i_13_][i] & 0x2) != 0) {
			return i_12_ - 1;
		}
		return i_12_;
	}

	public static final void method165(int i, int i_15_, int i_16_, int i_17_, CollisionMap collisionMap,
		int i_18_, int i_19_, int i_20_, int i_21_, Class22 class22, int[][][] is) {
		int i_22_ = is[i_15_][i_19_][i_17_];
		int i_23_ = is[i_15_][i_19_ + 1][i_17_];
		int i_24_ = is[i_15_][i_19_ + 1][i_17_ + 1];
		int i_25_ = is[i_15_][i_19_][i_17_ + 1];
		int i_26_ = i_22_ + i_23_ + i_24_ + i_25_ >> 2;
		ObjectDefinition objectDefinition = ObjectDefinition.method434(i);
		if (i_20_ == 0) {
			int i_27_ = i_19_ + (i_17_ << 7) + (i << 14) + 1073741824;
			if (!objectDefinition.aBoolean759) {
				i_27_ -= -2147483648;
			}
			byte i_28_ = (byte) ((i_18_ << 6) + i_16_);
			if (i_16_ == 22) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition
						.method442(22, i_18_, i_22_, i_23_, i_24_, i_25_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 22, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method247(i_19_, i_17_, 669, i_28_, i_27_, i_26_, i_21_, class50_sub1_sub4);
				if (objectDefinition.aBoolean810 && objectDefinition.aBoolean759) {
					collisionMap.method425(i_17_, i_19_);
				}
			} else if (i_16_ == 10 || i_16_ == 11) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition
						.method442(10, i_18_, i_22_, i_23_, i_24_, i_25_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 10, (byte) 3, i, true, i_22_, i_18_);
				}
				if (class50_sub1_sub4 != null) {
					int i_29_ = 0;
					if (i_16_ == 11) {
						i_29_ += 256;
					}
					int i_30_;
					int i_31_;
					if (i_18_ == 1 || i_18_ == 3) {
						i_30_ = objectDefinition.anInt775;
						i_31_ = objectDefinition.anInt801;
					} else {
						i_30_ = objectDefinition.anInt801;
						i_31_ = objectDefinition.anInt775;
					}
					class22.method251(i_21_, i_30_, i_17_, class50_sub1_sub4, i_28_, i_29_, i_19_,
						-896, i_31_, i_26_, i_27_);
				}
				if (objectDefinition.aBoolean810) {
					collisionMap.method424(i_17_, i_18_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_19_);
				}
			} else if (i_16_ >= 12) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(i_16_, i_18_, i_22_, i_23_, i_24_, i_25_,
						-1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, i_16_, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method251(i_21_, 1, i_17_, class50_sub1_sub4, i_28_, 0, i_19_, -896, 1,
					i_26_, i_27_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method424(i_17_, i_18_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_19_);
				}
			} else if (i_16_ == 0) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(0, i_18_, i_22_, i_23_, i_24_, i_25_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 0, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method249(i_26_, 49878, 0, Class8.anIntArray158[i_18_], null, i_19_, i_27_,
					i_28_, i_17_, class50_sub1_sub4, i_21_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method423(i_18_, 37679, objectDefinition.aBoolean809, i_16_, i_19_, i_17_);
				}
			} else if (i_16_ == 1) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(1, i_18_, i_22_, i_23_, i_24_, i_25_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 1, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method249(i_26_, 49878, 0, Class8.anIntArray167[i_18_], null, i_19_, i_27_,
					i_28_, i_17_, class50_sub1_sub4, i_21_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method423(i_18_, 37679, objectDefinition.aBoolean809, i_16_, i_19_, i_17_);
				}
			} else if (i_16_ == 2) {
				int i_32_ = i_18_ + 1 & 0x3;
				Class50_Sub1_Sub4 class50_sub1_sub4;
				Class50_Sub1_Sub4 class50_sub1_sub4_33_;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(2, i_18_ + 4, i_22_, i_23_, i_24_, i_25_,
						-1);
					class50_sub1_sub4_33_ = objectDefinition.method442(2, i_32_, i_22_, i_23_, i_24_, i_25_,
						-1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 2, (byte) 3, i, true, i_22_, i_18_ + 4);
					class50_sub1_sub4_33_ = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
						i_25_, i_23_, 2, (byte) 3, i, true, i_22_, i_32_);
				}
				class22.method249(i_26_, 49878, Class8.anIntArray158[i_32_],
					Class8.anIntArray158[i_18_], class50_sub1_sub4_33_, i_19_, i_27_, i_28_, i_17_,
					class50_sub1_sub4, i_21_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method423(i_18_, 37679, objectDefinition.aBoolean809, i_16_, i_19_, i_17_);
				}
			} else if (i_16_ == 3) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(3, i_18_, i_22_, i_23_, i_24_, i_25_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, 3, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method249(i_26_, 49878, 0, Class8.anIntArray167[i_18_], null, i_19_, i_27_,
					i_28_, i_17_, class50_sub1_sub4, i_21_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method423(i_18_, 37679, objectDefinition.aBoolean809, i_16_, i_19_, i_17_);
				}
			} else if (i_16_ == 9) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(i_16_, i_18_, i_22_, i_23_, i_24_, i_25_,
						-1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_, i_25_,
						i_23_, i_16_, (byte) 3, i, true, i_22_, i_18_);
				}
				class22.method251(i_21_, 1, i_17_, class50_sub1_sub4, i_28_, 0, i_19_, -896, 1,
					i_26_, i_27_);
				if (objectDefinition.aBoolean810) {
					collisionMap.method424(i_17_, i_18_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_19_);
				}
			} else {
				if (objectDefinition.aBoolean769) {
					if (i_18_ == 1) {
						int i_34_ = i_25_;
						i_25_ = i_24_;
						i_24_ = i_23_;
						i_23_ = i_22_;
						i_22_ = i_34_;
					} else if (i_18_ == 2) {
						int i_35_ = i_25_;
						i_25_ = i_23_;
						i_23_ = i_35_;
						i_35_ = i_24_;
						i_24_ = i_22_;
						i_22_ = i_35_;
					} else if (i_18_ == 3) {
						int i_36_ = i_25_;
						i_25_ = i_22_;
						i_22_ = i_23_;
						i_23_ = i_24_;
						i_24_ = i_36_;
					}
				}
				if (i_16_ == 4) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_22_, i_23_, i_24_, i_25_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
							i_25_, i_23_, 4, (byte) 3, i, true, i_22_, 0);
					}
					class22.method250(i_21_, Class8.anIntArray158[i_18_], i_18_ * 512, i_27_,
						i_28_, i_19_, 0, i_17_, 0, i_26_, class50_sub1_sub4, -930);
				} else if (i_16_ == 5) {
					int i_37_ = 16;
					int i_38_ = class22.method267(i_21_, i_19_, i_17_);
					if (i_38_ > 0) {
						i_37_ = ObjectDefinition.method434(i_38_ >> 14 & 0x7fff).anInt802;
					}
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_22_, i_23_, i_24_, i_25_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
							i_25_, i_23_, 4, (byte) 3, i, true, i_22_, 0);
					}
					class22.method250(i_21_, Class8.anIntArray158[i_18_], i_18_ * 512, i_27_,
						i_28_, i_19_, Class8.anIntArray143[i_18_] * i_37_, i_17_,
						Class8.anIntArray161[i_18_] * i_37_, i_26_, class50_sub1_sub4, -930);
				} else if (i_16_ == 6) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_22_, i_23_, i_24_, i_25_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
							i_25_, i_23_, 4, (byte) 3, i, true, i_22_, 0);
					}
					class22.method250(i_21_, 256, i_18_, i_27_, i_28_, i_19_, 0, i_17_, 0, i_26_,
						class50_sub1_sub4, -930);
				} else if (i_16_ == 7) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_22_, i_23_, i_24_, i_25_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
							i_25_, i_23_, 4, (byte) 3, i, true, i_22_, 0);
					}
					class22.method250(i_21_, 512, i_18_, i_27_, i_28_, i_19_, 0, i_17_, 0, i_26_,
						class50_sub1_sub4, -930);
				} else if (i_16_ == 8) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_22_, i_23_, i_24_, i_25_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_24_,
							i_25_, i_23_, 4, (byte) 3, i, true, i_22_, 0);
					}
					class22.method250(i_21_, 768, i_18_, i_27_, i_28_, i_19_, 0, i_17_, 0, i_26_,
						class50_sub1_sub4, -930);
				}
			}
		}
	}

	public final void method166(int i, int i_39_, int i_40_, int i_41_) {
		if (i == anInt160) {
			for (int i_42_ = 0; i_42_ < 8; i_42_++) {
				for (int i_43_ = 0; i_43_ < 8; i_43_++) {
					anIntArrayArrayArray149[i_39_][i_41_ + i_42_][(i_40_ + i_43_)] = 0;
				}
			}
			if (i_41_ > 0) {
				for (int i_44_ = 1; i_44_ < 8; i_44_++) {
					anIntArrayArrayArray149[i_39_][i_41_][i_40_ + i_44_] = (anIntArrayArrayArray149[i_39_][i_41_ - 1][i_40_
						+ i_44_]);
				}
			}
			if (i_40_ > 0) {
				for (int i_45_ = 1; i_45_ < 8; i_45_++) {
					anIntArrayArrayArray149[i_39_][i_41_ + i_45_][i_40_] = (anIntArrayArrayArray149[i_39_][i_41_
						+ i_45_][i_40_ - 1]);
				}
			}
			if (i_41_ > 0 && anIntArrayArrayArray149[i_39_][i_41_ - 1][i_40_] != 0) {
				anIntArrayArrayArray149[i_39_][i_41_][i_40_] = anIntArrayArrayArray149[i_39_][i_41_ - 1][i_40_];
			} else if (i_40_ > 0 && anIntArrayArrayArray149[i_39_][i_41_][i_40_ - 1] != 0) {
				anIntArrayArrayArray149[i_39_][i_41_][i_40_] = anIntArrayArrayArray149[i_39_][i_41_][i_40_ - 1];
			} else if (i_41_ > 0 && i_40_ > 0
				&& (anIntArrayArrayArray149[i_39_][i_41_ - 1][i_40_ - 1] != 0)) {
				anIntArrayArrayArray149[i_39_][i_41_][i_40_] = anIntArrayArrayArray149[i_39_][i_41_ - 1][i_40_ - 1];
			}
		}
	}

	public final void method167(CollisionMap[] class46s, int i, Class22 class22) {
		for (int i_46_ = 0; i_46_ < 4; i_46_++) {
			for (int i_47_ = 0; i_47_ < 104; i_47_++) {
				for (int i_48_ = 0; i_48_ < 104; i_48_++) {
					if ((aByteArrayArrayArray138[i_46_][i_47_][i_48_] & 0x1) == 1) {
						int i_49_ = i_46_;
						if ((aByteArrayArrayArray138[1][i_47_][i_48_] & 0x2) == 2) {
							i_49_--;
						}
						if (i_49_ >= 0) {
							class46s[i_49_].method425(i_48_, i_47_);
						}
					}
				}
			}
		}
		Class8.anInt141 += (int) (Math.random() * 5.0) - 2;
		if (Class8.anInt141 < -8) {
			Class8.anInt141 = -8;
		}
		if (Class8.anInt141 > 8) {
			Class8.anInt141 = 8;
		}
		Class8.anInt163 += (int) (Math.random() * 5.0) - 2;
		if (Class8.anInt163 < -16) {
			Class8.anInt163 = -16;
		}
		if (Class8.anInt163 > 16) {
			Class8.anInt163 = 16;
		}
		for (int i_50_ = 0; i_50_ < 4; i_50_++) {
			byte[][] is = aByteArrayArrayArray164[i_50_];
			int i_51_ = 96;
			int i_52_ = 768;
			int i_53_ = -50;
			int i_54_ = -10;
			int i_55_ = -50;
			int i_56_ = (int) Math.sqrt((i_53_ * i_53_ + i_54_ * i_54_ + i_55_ * i_55_));
			int i_57_ = i_52_ * i_56_ >> 8;
			for (int i_58_ = 1; i_58_ < anInt152 - 1; i_58_++) {
				for (int i_59_ = 1; i_59_ < anInt151 - 1; i_59_++) {
					int i_60_ = (anIntArrayArrayArray149[i_50_][i_59_ + 1][i_58_] - anIntArrayArrayArray149[i_50_][i_59_ - 1][i_58_]);
					int i_61_ = (anIntArrayArrayArray149[i_50_][i_59_][i_58_ + 1] - anIntArrayArrayArray149[i_50_][i_59_][i_58_ - 1]);
					int i_62_ = (int) Math.sqrt((i_60_ * i_60_ + 65536 + i_61_ * i_61_));
					int i_63_ = (i_60_ << 8) / i_62_;
					int i_64_ = 65536 / i_62_;
					int i_65_ = (i_61_ << 8) / i_62_;
					int i_66_ = i_51_ + (i_53_ * i_63_ + i_54_ * i_64_ + i_55_ * i_65_) / i_57_;
					int i_67_ = ((is[i_59_ - 1][i_58_] >> 2) + (is[i_59_ + 1][i_58_] >> 3)
						+ (is[i_59_][i_58_ - 1] >> 2) + (is[i_59_][i_58_ + 1] >> 3) + (is[i_59_][i_58_] >> 1));
					anIntArrayArray165[i_59_][i_58_] = i_66_ - i_67_;
				}
			}
			for (int i_68_ = 0; i_68_ < anInt152; i_68_++) {
				anIntArray144[i_68_] = 0;
				anIntArray145[i_68_] = 0;
				anIntArray146[i_68_] = 0;
				anIntArray147[i_68_] = 0;
				anIntArray148[i_68_] = 0;
			}
			for (int i_69_ = -5; i_69_ < anInt151 + 5; i_69_++) {
				for (int i_70_ = 0; i_70_ < anInt152; i_70_++) {
					int i_71_ = i_69_ + 5;
					if (i_71_ >= 0 && i_71_ < anInt151) {
						int i_72_ = (aByteArrayArrayArray159[i_50_][i_71_][i_70_] & 0xff);
						if (i_72_ > 0) {
							Floor floor = Floor.floors[i_72_ - 1];
							anIntArray144[i_70_] += floor.anInt323;
							anIntArray145[i_70_] += floor.anInt321;
							anIntArray146[i_70_] += floor.anInt322;
							anIntArray147[i_70_] += floor.anInt324;
							anIntArray148[i_70_]++;
						}
					}
					int i_73_ = i_69_ - 5;
					if (i_73_ >= 0 && i_73_ < anInt151) {
						int i_74_ = (aByteArrayArrayArray159[i_50_][i_73_][i_70_] & 0xff);
						if (i_74_ > 0) {
							Floor floor = Floor.floors[i_74_ - 1];
							anIntArray144[i_70_] -= floor.anInt323;
							anIntArray145[i_70_] -= floor.anInt321;
							anIntArray146[i_70_] -= floor.anInt322;
							anIntArray147[i_70_] -= floor.anInt324;
							anIntArray148[i_70_]--;
						}
					}
				}
				if (i_69_ >= 1 && i_69_ < anInt151 - 1) {
					int i_75_ = 0;
					int i_76_ = 0;
					int i_77_ = 0;
					int i_78_ = 0;
					int i_79_ = 0;
					for (int i_80_ = -5; i_80_ < anInt152 + 5; i_80_++) {
						int i_81_ = i_80_ + 5;
						if (i_81_ >= 0 && i_81_ < anInt152) {
							i_75_ += anIntArray144[i_81_];
							i_76_ += anIntArray145[i_81_];
							i_77_ += anIntArray146[i_81_];
							i_78_ += anIntArray147[i_81_];
							i_79_ += anIntArray148[i_81_];
						}
						int i_82_ = i_80_ - 5;
						if (i_82_ >= 0 && i_82_ < anInt152) {
							i_75_ -= anIntArray144[i_82_];
							i_76_ -= anIntArray145[i_82_];
							i_77_ -= anIntArray146[i_82_];
							i_78_ -= anIntArray147[i_82_];
							i_79_ -= anIntArray148[i_82_];
						}
						if (i_80_ >= 1
							&& i_80_ < anInt152 - 1
							&& (!Class8.aBoolean169
								|| (aByteArrayArrayArray138[0][i_69_][i_80_] & 0x2) != 0 || (((aByteArrayArrayArray138[i_50_][i_69_][i_80_]) & 0x10) == 0 && method164(
								i_80_, i_50_, i_69_, (byte) 0) == Class8.anInt162))) {
							if (i_50_ < Class8.anInt150) {
								Class8.anInt150 = i_50_;
							}
							int i_83_ = (aByteArrayArrayArray159[i_50_][i_69_][i_80_] & 0xff);
							int i_84_ = (aByteArrayArrayArray155[i_50_][i_69_][i_80_] & 0xff);
							if (i_83_ > 0 || i_84_ > 0) {
								int i_85_ = (anIntArrayArrayArray149[i_50_][i_69_][i_80_]);
								int i_86_ = (anIntArrayArrayArray149[i_50_][i_69_ + 1][i_80_]);
								int i_87_ = (anIntArrayArrayArray149[i_50_][i_69_ + 1][i_80_ + 1]);
								int i_88_ = (anIntArrayArrayArray149[i_50_][i_69_][i_80_ + 1]);
								int i_89_ = anIntArrayArray165[i_69_][i_80_];
								int i_90_ = anIntArrayArray165[i_69_ + 1][i_80_];
								int i_91_ = anIntArrayArray165[i_69_ + 1][i_80_ + 1];
								int i_92_ = anIntArrayArray165[i_69_][i_80_ + 1];
								int i_93_ = -1;
								int i_94_ = -1;
								if (i_83_ > 0) {
									int i_95_ = i_75_ * 256 / i_78_;
									int i_96_ = i_76_ / i_79_;
									int i_97_ = i_77_ / i_79_;
									i_93_ = method177(i_95_, i_96_, i_97_);
									i_95_ = i_95_ + Class8.anInt141 & 0xff;
									i_97_ += Class8.anInt163;
									if (i_97_ < 0) {
										i_97_ = 0;
									} else if (i_97_ > 255) {
										i_97_ = 255;
									}
									i_94_ = method177(i_95_, i_96_, i_97_);
								}
								if (i_50_ > 0) {
									boolean bool = true;
									if (i_83_ == 0
										&& (aByteArrayArrayArray153[i_50_][i_69_][i_80_]) != 0) {
										bool = false;
									}
									if (i_84_ > 0
										&& !(Floor.floors[i_84_ - 1].aBoolean319)) {
										bool = false;
									}
									if (bool && i_85_ == i_86_ && i_85_ == i_87_ && i_85_ == i_88_) {
										anIntArrayArrayArray168[i_50_][i_69_][i_80_] |= 0x924;
									}
								}
								int i_98_ = 0;
								if (i_93_ != -1) {
									i_98_ = (Renderer3D.anIntArray1548[Class8
										.method171(i_94_, 96)]);
								}
								if (i_84_ == 0) {
									class22.method246(i_50_, i_69_, i_80_, 0, 0, -1, i_85_, i_86_,
										i_87_, i_88_, Class8.method171(i_93_, i_89_),
										Class8.method171(i_93_, i_90_),
										Class8.method171(i_93_, i_91_),
										Class8.method171(i_93_, i_92_), 0, 0, 0, 0, i_98_, 0);
								} else {
									int i_99_ = ((aByteArrayArrayArray153[i_50_][i_69_][i_80_]) + 1);
									byte i_100_ = (aByteArrayArrayArray142[i_50_][i_69_][i_80_]);
									Floor floor = Floor.floors[i_84_ - 1];
									int i_101_ = floor.anInt317;
									int i_102_;
									int i_103_;
									if (i_101_ >= 0) {
										i_103_ = Renderer3D.method509(i_101_, 0);
										i_102_ = -1;
									} else if (floor.anInt316 == 16711935) {
										i_102_ = -2;
										i_101_ = -1;
										i_103_ = (Renderer3D.anIntArray1548[method182(
											floor.anInt325, 96)]);
									} else {
										i_102_ = method177(floor.anInt320, floor.anInt321,
											floor.anInt322);
										i_103_ = (Renderer3D.anIntArray1548[method182(
											floor.anInt325, 96)]);
									}
									class22.method246(i_50_, i_69_, i_80_, i_99_, i_100_, i_101_,
										i_85_, i_86_, i_87_, i_88_, Class8.method171(i_93_, i_89_),
										Class8.method171(i_93_, i_90_),
										Class8.method171(i_93_, i_91_),
										Class8.method171(i_93_, i_92_), method182(i_102_, i_89_),
										method182(i_102_, i_90_), method182(i_102_, i_91_),
										method182(i_102_, i_92_), i_98_, i_103_);
								}
							}
						}
					}
				}
			}
			for (int i_104_ = 1; i_104_ < anInt152 - 1; i_104_++) {
				for (int i_105_ = 1; i_105_ < anInt151 - 1; i_105_++) {
					class22.method245(i_50_, i_105_, i_104_,
						method164(i_104_, i_50_, i_105_, (byte) 0));
				}
			}
		}
		class22.method272((byte) 2, -10, -50, -50);
		for (int i_106_ = 0; i_106_ < anInt151; i_106_++) {
			for (int i_107_ = 0; i_107_ < anInt152; i_107_++) {
				if ((aByteArrayArrayArray138[1][i_106_][i_107_] & 0x2) == 2) {
					class22.method243(true, i_106_, i_107_);
				}
			}
		}
		if (i <= 0) {
			anInt160 = 313;
		}
		int i_108_ = 1;
		int i_109_ = 2;
		int i_110_ = 4;
		for (int i_111_ = 0; i_111_ < 4; i_111_++) {
			if (i_111_ > 0) {
				i_108_ <<= 3;
				i_109_ <<= 3;
				i_110_ <<= 3;
			}
			for (int i_112_ = 0; i_112_ <= i_111_; i_112_++) {
				for (int i_113_ = 0; i_113_ <= anInt152; i_113_++) {
					for (int i_114_ = 0; i_114_ <= anInt151; i_114_++) {
						if ((anIntArrayArrayArray168[i_112_][i_114_][i_113_] & i_108_) != 0) {
							int i_115_ = i_113_;
							int i_116_ = i_113_;
							int i_117_ = i_112_;
							int i_118_ = i_112_;
							for (/**/; i_115_ > 0; i_115_--) {
								if (((anIntArrayArrayArray168[i_112_][i_114_][i_115_ - 1]) & i_108_) == 0) {
									break;
								}
							}
							for (/**/; i_116_ < anInt152; i_116_++) {
								if (((anIntArrayArrayArray168[i_112_][i_114_][i_116_ + 1]) & i_108_) == 0) {
									break;
								}
							}
							while_0_: for (/**/; i_117_ > 0; i_117_--) {
								for (int i_119_ = i_115_; i_119_ <= i_116_; i_119_++) {
									if (((anIntArrayArrayArray168[i_117_ - 1][i_114_][i_119_]) & i_108_) == 0) {
										break while_0_;
									}
								}
							}
							while_1_: for (/**/; i_118_ < i_111_; i_118_++) {
								for (int i_120_ = i_115_; i_120_ <= i_116_; i_120_++) {
									if (((anIntArrayArrayArray168[i_118_ + 1][i_114_][i_120_]) & i_108_) == 0) {
										break while_1_;
									}
								}
							}
							int i_121_ = ((i_118_ + 1 - i_117_) * (i_116_ - i_115_ + 1));
							if (i_121_ >= 8) {
								int i_122_ = 240;
								int i_123_ = ((anIntArrayArrayArray149[i_118_][i_114_][i_115_]) - i_122_);
								int i_124_ = (anIntArrayArrayArray149[i_117_][i_114_][i_115_]);
								Class22.method244(-8967, i_114_ * 128, i_124_, i_114_ * 128,
									i_116_ * 128 + 128, i_111_, i_115_ * 128, i_123_, 1);
								for (int i_125_ = i_117_; i_125_ <= i_118_; i_125_++) {
									for (int i_126_ = i_115_; i_126_ <= i_116_; i_126_++) {
										anIntArrayArrayArray168[i_125_][i_114_][i_126_] &= i_108_ ^ 0xffffffff;
									}
								}
							}
						}
						if ((anIntArrayArrayArray168[i_112_][i_114_][i_113_] & i_109_) != 0) {
							int i_127_ = i_114_;
							int i_128_ = i_114_;
							int i_129_ = i_112_;
							int i_130_ = i_112_;
							for (/**/; i_127_ > 0; i_127_--) {
								if (((anIntArrayArrayArray168[i_112_][i_127_ - 1][i_113_]) & i_109_) == 0) {
									break;
								}
							}
							for (/**/; i_128_ < anInt151; i_128_++) {
								if (((anIntArrayArrayArray168[i_112_][i_128_ + 1][i_113_]) & i_109_) == 0) {
									break;
								}
							}
							while_2_: for (/**/; i_129_ > 0; i_129_--) {
								for (int i_131_ = i_127_; i_131_ <= i_128_; i_131_++) {
									if (((anIntArrayArrayArray168[i_129_ - 1][i_131_][i_113_]) & i_109_) == 0) {
										break while_2_;
									}
								}
							}
							while_3_: for (/**/; i_130_ < i_111_; i_130_++) {
								for (int i_132_ = i_127_; i_132_ <= i_128_; i_132_++) {
									if (((anIntArrayArrayArray168[i_130_ + 1][i_132_][i_113_]) & i_109_) == 0) {
										break while_3_;
									}
								}
							}
							int i_133_ = ((i_130_ + 1 - i_129_) * (i_128_ - i_127_ + 1));
							if (i_133_ >= 8) {
								int i_134_ = 240;
								int i_135_ = ((anIntArrayArrayArray149[i_130_][i_127_][i_113_]) - i_134_);
								int i_136_ = (anIntArrayArrayArray149[i_129_][i_127_][i_113_]);
								Class22.method244(-8967, i_127_ * 128, i_136_, i_128_ * 128 + 128,
									i_113_ * 128, i_111_, i_113_ * 128, i_135_, 2);
								for (int i_137_ = i_129_; i_137_ <= i_130_; i_137_++) {
									for (int i_138_ = i_127_; i_138_ <= i_128_; i_138_++) {
										anIntArrayArrayArray168[i_137_][i_138_][i_113_] &= i_109_ ^ 0xffffffff;
									}
								}
							}
						}
						if ((anIntArrayArrayArray168[i_112_][i_114_][i_113_] & i_110_) != 0) {
							int i_139_ = i_114_;
							int i_140_ = i_114_;
							int i_141_ = i_113_;
							int i_142_ = i_113_;
							for (/**/; i_141_ > 0; i_141_--) {
								if (((anIntArrayArrayArray168[i_112_][i_114_][i_141_ - 1]) & i_110_) == 0) {
									break;
								}
							}
							for (/**/; i_142_ < anInt152; i_142_++) {
								if (((anIntArrayArrayArray168[i_112_][i_114_][i_142_ + 1]) & i_110_) == 0) {
									break;
								}
							}
							while_4_: for (/**/; i_139_ > 0; i_139_--) {
								for (int i_143_ = i_141_; i_143_ <= i_142_; i_143_++) {
									if (((anIntArrayArrayArray168[i_112_][i_139_ - 1][i_143_]) & i_110_) == 0) {
										break while_4_;
									}
								}
							}
							while_5_: for (/**/; i_140_ < anInt151; i_140_++) {
								for (int i_144_ = i_141_; i_144_ <= i_142_; i_144_++) {
									if (((anIntArrayArrayArray168[i_112_][i_140_ + 1][i_144_]) & i_110_) == 0) {
										break while_5_;
									}
								}
							}
							if ((i_140_ - i_139_ + 1) * (i_142_ - i_141_ + 1) >= 4) {
								int i_145_ = (anIntArrayArrayArray149[i_112_][i_139_][i_141_]);
								Class22.method244(-8967, i_139_ * 128, i_145_, i_140_ * 128 + 128,
									i_142_ * 128 + 128, i_111_, i_141_ * 128, i_145_, 4);
								for (int i_146_ = i_139_; i_146_ <= i_140_; i_146_++) {
									for (int i_147_ = i_141_; i_147_ <= i_142_; i_147_++) {
										anIntArrayArrayArray168[i_112_][i_146_][i_147_] &= i_110_ ^ 0xffffffff;
									}
								}
							}
						}
					}
				}
			}
		}
	}

	public final void method168(int i, int i_148_, boolean bool, byte[] is, int i_149_, int i_150_,
		int i_151_, CollisionMap[] class46s, int i_152_, int i_153_) {
		if (bool) {
			anInt166 = 476;
		}
		for (int i_154_ = 0; i_154_ < 8; i_154_++) {
			for (int i_155_ = 0; i_155_ < 8; i_155_++) {
				if (i_151_ + i_154_ > 0 && i_151_ + i_154_ < 103 && i_152_ + i_155_ > 0
					&& i_152_ + i_155_ < 103) {
					class46s[i_149_].anIntArrayArray757[i_151_ + i_154_][i_152_ + i_155_] &= ~0x1000000;
				}
			}
		}
		Packet packet = new Packet(is);
		for (int i_156_ = 0; i_156_ < 4; i_156_++) {
			for (int i_157_ = 0; i_157_ < 64; i_157_++) {
				for (int i_158_ = 0; i_158_ < 64; i_158_++) {
					if (i_156_ == i_150_ && i_157_ >= i_153_ && i_157_ < i_153_ + 8
						&& i_158_ >= i_148_ && i_158_ < i_148_ + 8) {
						method183(0, (byte) -61, 0, packet, i,
							i_151_ + Class34.method348((byte) 7, i, i_157_ & 0x7, i_158_ & 0x7),
							i_149_,
							i_152_ + Class34.method349(i_158_ & 0x7, i_157_ & 0x7, i, (byte) 5));
					} else {
						method183(0, (byte) -61, 0, packet, 0, -1, 0, -1);
					}
				}
			}
		}
	}

	public static final void method169(Class32_Sub1 class32_sub1,
		Packet packet, byte i) {
		if (i == -3) {
			int i_159_ = -1;
			for (;;) {
				int i_160_ = packet.getSmart();
				if (i_160_ == 0) {
					break;
				}
				i_159_ += i_160_;
				ObjectDefinition objectDefinition = ObjectDefinition.method434(i_159_);
				objectDefinition.method436(class32_sub1);
				for (;;) {
					int i_161_ = packet.getSmart();
					if (i_161_ == 0) {
						break;
					}
					packet.getUByte();
				}
			}
		}
	}

	public static final boolean method170(int i, byte i_162_, int i_163_) {
		ObjectDefinition objectDefinition = ObjectDefinition.method434(i_163_);
		if (i_162_ != Class8.aByte154) {
			for (int i_164_ = 1; i_164_ > 0; i_164_++) {
				/* empty */
			}
		}
		if (i == 11) {
			i = 10;
		}
		if (i >= 5 && i <= 8) {
			i = 4;
		}
		return objectDefinition.method443(26261, i);
	}

	private static final int method171(int i, int i_165_) {
		if (i == -1) {
			return 12345678;
		}
		i_165_ = i_165_ * (i & 0x7f) / 128;
		if (i_165_ < 2) {
			i_165_ = 2;
		} else if (i_165_ > 126) {
			i_165_ = 126;
		}
		return (i & 0xff80) + i_165_;
	}

	public final void method172(int i, CollisionMap[] class46s, Class22 class22, boolean bool,
		byte[] is, int i_166_, int i_167_, int i_168_, int i_169_, int i_170_, int i_171_) {
		Packet packet = new Packet(is);
		if (!bool) {
			int i_172_ = -1;
			for (;;) {
				int i_173_ = packet.getSmart();
				if (i_173_ == 0) {
					break;
				}
				i_172_ += i_173_;
				int i_174_ = 0;
				for (;;) {
					int i_175_ = packet.getSmart();
					if (i_175_ == 0) {
						break;
					}
					i_174_ += i_175_ - 1;
					int i_176_ = i_174_ & 0x3f;
					int i_177_ = i_174_ >> 6 & 0x3f;
					int i_178_ = i_174_ >> 12;
					int i_179_ = packet.getUByte();
					int i_180_ = i_179_ >> 2;
					int i_181_ = i_179_ & 0x3;
					if (i_178_ == i_171_ && i_177_ >= i_168_ && i_177_ < i_168_ + 8
						&& i_176_ >= i_170_ && i_176_ < i_170_ + 8) {
						ObjectDefinition objectDefinition = ObjectDefinition.method434(i_172_);
						int i_182_ = (i_169_ + Class34.method350(i_167_, objectDefinition.anInt775, i_181_,
							i_177_ & 0x7, (byte) -117, objectDefinition.anInt801, i_176_ & 0x7));
						int i_183_ = i_166_;
						int i_184_ = Class34.method351(objectDefinition.anInt801, i_167_, 671, i_177_ & 0x7,
							i_176_ & 0x7, objectDefinition.anInt775, i_181_);
						int i_185_ = i_184_ + i_183_;
						if (i_182_ > 0 && i_185_ > 0 && i_182_ < 103 && i_185_ < 103) {
							int i_186_ = i;
							if ((aByteArrayArrayArray138[1][i_182_][i_185_] & 0x2) == 2) {
								i_186_--;
							}
							CollisionMap collisionMap = null;
							if (i_186_ >= 0) {
								collisionMap = class46s[i_186_];
							}
							method173(class22, collisionMap, i_185_, i, i_182_, aByte139, i_181_
								+ i_167_ & 0x3, i_180_, i_172_);
						}
					}
				}
			}
		}
	}

	private final void method173(Class22 class22, CollisionMap collisionMap, int i, int i_187_, int i_188_,
		byte i_189_, int i_190_, int i_191_, int i_192_) {
		if (!Class8.aBoolean169
			|| (aByteArrayArrayArray138[0][i_188_][i] & 0x2) != 0
			|| ((aByteArrayArrayArray138[i_187_][i_188_][i] & 0x10) == 0 && method164(i, i_187_,
				i_188_, (byte) 0) == Class8.anInt162)) {
			if (i_187_ < Class8.anInt150) {
				Class8.anInt150 = i_187_;
			}
			int i_193_ = anIntArrayArrayArray149[i_187_][i_188_][i];
			int i_194_ = anIntArrayArrayArray149[i_187_][i_188_ + 1][i];
			int i_195_ = anIntArrayArrayArray149[i_187_][i_188_ + 1][i + 1];
			int i_196_ = anIntArrayArrayArray149[i_187_][i_188_][i + 1];
			int i_197_ = i_193_ + i_194_ + i_195_ + i_196_ >> 2;
			ObjectDefinition objectDefinition = ObjectDefinition.method434(i_192_);
			int i_198_ = i_188_ + (i << 7) + (i_192_ << 14) + 1073741824;
			if (i_189_ != 0) {
				aBoolean157 = !aBoolean157;
			}
			if (!objectDefinition.aBoolean759) {
				i_198_ -= -2147483648;
			}
			byte i_199_ = (byte) ((i_190_ << 6) + i_191_);
			if (i_191_ == 22) {
				if (!Class8.aBoolean169 || objectDefinition.aBoolean759 || objectDefinition.aBoolean765) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(22, i_190_, i_193_, i_194_, i_195_,
							i_196_, -1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 22, (byte) 3, i_192_, true, i_193_, i_190_);
					}
					class22.method247(i_188_, i, 669, i_199_, i_198_, i_197_, i_187_,
						class50_sub1_sub4);
					if (objectDefinition.aBoolean810 && objectDefinition.aBoolean759 && collisionMap != null) {
						collisionMap.method425(i, i_188_);
					}
				}
			} else if (i_191_ == 10 || i_191_ == 11) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(10, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 10, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				if (class50_sub1_sub4 != null) {
					int i_200_ = 0;
					if (i_191_ == 11) {
						i_200_ += 256;
					}
					int i_201_;
					int i_202_;
					if (i_190_ == 1 || i_190_ == 3) {
						i_201_ = objectDefinition.anInt775;
						i_202_ = objectDefinition.anInt801;
					} else {
						i_201_ = objectDefinition.anInt801;
						i_202_ = objectDefinition.anInt775;
					}
					if (class22.method251(i_187_, i_201_, i, class50_sub1_sub4, i_199_, i_200_,
						i_188_, -896, i_202_, i_197_, i_198_) && objectDefinition.aBoolean807) {
						Model model;
						if (class50_sub1_sub4 instanceof Model) {
							model = (Model) class50_sub1_sub4;
						} else {
							model = objectDefinition.method442(10, i_190_, i_193_, i_194_,
								i_195_, i_196_, -1);
						}
						if (model != null) {
							for (int i_203_ = 0; i_203_ <= i_201_; i_203_++) {
								for (int i_204_ = 0; i_204_ <= i_202_; i_204_++) {
									int i_205_ = model.anInt1671 / 4;
									if (i_205_ > 30) {
										i_205_ = 30;
									}
									if (i_205_ > (aByteArrayArrayArray164[i_187_][i_188_ + i_203_][i
										+ i_204_])) {
										aByteArrayArrayArray164[i_187_][i_188_ + i_203_][i + i_204_] = (byte) i_205_;
									}
								}
							}
						}
					}
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method424(i, i_190_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_188_);
				}
			} else if (i_191_ >= 12) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(i_191_, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, i_191_, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				class22.method251(i_187_, 1, i, class50_sub1_sub4, i_199_, 0, i_188_, -896, 1,
					i_197_, i_198_);
				if (i_191_ >= 12 && i_191_ <= 17 && i_191_ != 13 && i_187_ > 0) {
					anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x924;
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method424(i, i_190_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_188_);
				}
			} else if (i_191_ == 0) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(0, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 0, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				class22.method249(i_197_, 49878, 0, Class8.anIntArray158[i_190_], null, i_188_,
					i_198_, i_199_, i, class50_sub1_sub4, i_187_);
				if (i_190_ == 0) {
					if (objectDefinition.aBoolean807) {
						aByteArrayArrayArray164[i_187_][i_188_][i] = (byte) 50;
						aByteArrayArrayArray164[i_187_][i_188_][i + 1] = (byte) 50;
					}
					if (objectDefinition.aBoolean797) {
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x249;
					}
				} else if (i_190_ == 1) {
					if (objectDefinition.aBoolean807) {
						aByteArrayArrayArray164[i_187_][i_188_][i + 1] = (byte) 50;
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i + 1] = (byte) 50;
					}
					if (objectDefinition.aBoolean797) {
						anIntArrayArrayArray168[i_187_][i_188_][i + 1] |= 0x492;
					}
				} else if (i_190_ == 2) {
					if (objectDefinition.aBoolean807) {
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i] = (byte) 50;
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i + 1] = (byte) 50;
					}
					if (objectDefinition.aBoolean797) {
						anIntArrayArrayArray168[i_187_][i_188_ + 1][i] |= 0x249;
					}
				} else if (i_190_ == 3) {
					if (objectDefinition.aBoolean807) {
						aByteArrayArrayArray164[i_187_][i_188_][i] = (byte) 50;
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i] = (byte) 50;
					}
					if (objectDefinition.aBoolean797) {
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x492;
					}
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method423(i_190_, 37679, objectDefinition.aBoolean809, i_191_, i_188_, i);
				}
				if (objectDefinition.anInt802 != 16) {
					class22.method257(i, objectDefinition.anInt802, i_187_, i_188_, 0);
				}
			} else if (i_191_ == 1) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(1, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 1, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				class22.method249(i_197_, 49878, 0, Class8.anIntArray167[i_190_], null, i_188_,
					i_198_, i_199_, i, class50_sub1_sub4, i_187_);
				if (objectDefinition.aBoolean807) {
					if (i_190_ == 0) {
						aByteArrayArrayArray164[i_187_][i_188_][i + 1] = (byte) 50;
					} else if (i_190_ == 1) {
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i + 1] = (byte) 50;
					} else if (i_190_ == 2) {
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i] = (byte) 50;
					} else if (i_190_ == 3) {
						aByteArrayArrayArray164[i_187_][i_188_][i] = (byte) 50;
					}
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method423(i_190_, 37679, objectDefinition.aBoolean809, i_191_, i_188_, i);
				}
			} else if (i_191_ == 2) {
				int i_206_ = i_190_ + 1 & 0x3;
				Class50_Sub1_Sub4 class50_sub1_sub4;
				Class50_Sub1_Sub4 class50_sub1_sub4_207_;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(2, i_190_ + 4, i_193_, i_194_, i_195_,
						i_196_, -1);
					class50_sub1_sub4_207_ = objectDefinition.method442(2, i_206_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 2, (byte) 3, i_192_, true, i_193_, i_190_ + 4);
					class50_sub1_sub4_207_ = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 2, (byte) 3, i_192_, true, i_193_, i_206_);
				}
				class22.method249(i_197_, 49878, Class8.anIntArray158[i_206_],
					Class8.anIntArray158[i_190_], class50_sub1_sub4_207_, i_188_, i_198_, i_199_,
					i, class50_sub1_sub4, i_187_);
				if (objectDefinition.aBoolean797) {
					if (i_190_ == 0) {
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x249;
						anIntArrayArrayArray168[i_187_][i_188_][i + 1] |= 0x492;
					} else if (i_190_ == 1) {
						anIntArrayArrayArray168[i_187_][i_188_][i + 1] |= 0x492;
						anIntArrayArrayArray168[i_187_][i_188_ + 1][i] |= 0x249;
					} else if (i_190_ == 2) {
						anIntArrayArrayArray168[i_187_][i_188_ + 1][i] |= 0x249;
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x492;
					} else if (i_190_ == 3) {
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x492;
						anIntArrayArrayArray168[i_187_][i_188_][i] |= 0x249;
					}
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method423(i_190_, 37679, objectDefinition.aBoolean809, i_191_, i_188_, i);
				}
				if (objectDefinition.anInt802 != 16) {
					class22.method257(i, objectDefinition.anInt802, i_187_, i_188_, 0);
				}
			} else if (i_191_ == 3) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(3, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, 3, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				class22.method249(i_197_, 49878, 0, Class8.anIntArray167[i_190_], null, i_188_,
					i_198_, i_199_, i, class50_sub1_sub4, i_187_);
				if (objectDefinition.aBoolean807) {
					if (i_190_ == 0) {
						aByteArrayArrayArray164[i_187_][i_188_][i + 1] = (byte) 50;
					} else if (i_190_ == 1) {
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i + 1] = (byte) 50;
					} else if (i_190_ == 2) {
						aByteArrayArrayArray164[i_187_][i_188_ + 1][i] = (byte) 50;
					} else if (i_190_ == 3) {
						aByteArrayArrayArray164[i_187_][i_188_][i] = (byte) 50;
					}
				}
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method423(i_190_, 37679, objectDefinition.aBoolean809, i_191_, i_188_, i);
				}
			} else if (i_191_ == 9) {
				Class50_Sub1_Sub4 class50_sub1_sub4;
				if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
					class50_sub1_sub4 = objectDefinition.method442(i_191_, i_190_, i_193_, i_194_, i_195_,
						i_196_, -1);
				} else {
					class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
						i_196_, i_194_, i_191_, (byte) 3, i_192_, true, i_193_, i_190_);
				}
				class22.method251(i_187_, 1, i, class50_sub1_sub4, i_199_, 0, i_188_, -896, 1,
					i_197_, i_198_);
				if (objectDefinition.aBoolean810 && collisionMap != null) {
					collisionMap.method424(i, i_190_, objectDefinition.anInt775, objectDefinition.anInt801,
						objectDefinition.aBoolean809, i_188_);
				}
			} else {
				if (objectDefinition.aBoolean769) {
					if (i_190_ == 1) {
						int i_208_ = i_196_;
						i_196_ = i_195_;
						i_195_ = i_194_;
						i_194_ = i_193_;
						i_193_ = i_208_;
					} else if (i_190_ == 2) {
						int i_209_ = i_196_;
						i_196_ = i_194_;
						i_194_ = i_209_;
						i_209_ = i_195_;
						i_195_ = i_193_;
						i_193_ = i_209_;
					} else if (i_190_ == 3) {
						int i_210_ = i_196_;
						i_196_ = i_193_;
						i_193_ = i_194_;
						i_194_ = i_195_;
						i_195_ = i_210_;
					}
				}
				if (i_191_ == 4) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_193_, i_194_, i_195_, i_196_,
							-1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 4, (byte) 3, i_192_, true, i_193_, 0);
					}
					class22.method250(i_187_, Class8.anIntArray158[i_190_], i_190_ * 512, i_198_,
						i_199_, i_188_, 0, i, 0, i_197_, class50_sub1_sub4, -930);
				} else if (i_191_ == 5) {
					int i_211_ = 16;
					int i_212_ = class22.method267(i_187_, i_188_, i);
					if (i_212_ > 0) {
						i_211_ = (ObjectDefinition.method434(i_212_ >> 14 & 0x7fff).anInt802);
					}
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_193_, i_194_, i_195_, i_196_,
							-1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 4, (byte) 3, i_192_, true, i_193_, 0);
					}
					class22.method250(i_187_, Class8.anIntArray158[i_190_], i_190_ * 512, i_198_,
						i_199_, i_188_, Class8.anIntArray143[i_190_] * i_211_, i,
						Class8.anIntArray161[i_190_] * i_211_, i_197_, class50_sub1_sub4, -930);
				} else if (i_191_ == 6) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_193_, i_194_, i_195_, i_196_,
							-1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 4, (byte) 3, i_192_, true, i_193_, 0);
					}
					class22.method250(i_187_, 256, i_190_, i_198_, i_199_, i_188_, 0, i, 0, i_197_,
						class50_sub1_sub4, -930);
				} else if (i_191_ == 7) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_193_, i_194_, i_195_, i_196_,
							-1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 4, (byte) 3, i_192_, true, i_193_, 0);
					}
					class22.method250(i_187_, 512, i_190_, i_198_, i_199_, i_188_, 0, i, 0, i_197_,
						class50_sub1_sub4, -930);
				} else if (i_191_ == 8) {
					Class50_Sub1_Sub4 class50_sub1_sub4;
					if (objectDefinition.anInt803 == -1 && objectDefinition.anIntArray805 == null) {
						class50_sub1_sub4 = objectDefinition.method442(4, 0, i_193_, i_194_, i_195_, i_196_,
							-1);
					} else {
						class50_sub1_sub4 = new Class50_Sub1_Sub4_Sub5(objectDefinition.anInt803, i_195_,
							i_196_, i_194_, 4, (byte) 3, i_192_, true, i_193_, 0);
					}
					class22.method250(i_187_, 768, i_190_, i_198_, i_199_, i_188_, 0, i, 0, i_197_,
						class50_sub1_sub4, -930);
				}
			}
		}
	}

	public final void method174(int i, boolean bool, int i_213_, int i_214_, byte[] is, int i_215_,
		CollisionMap[] class46s) {
		if (bool) {
			anInt166 = -379;
		}
		for (int i_216_ = 0; i_216_ < 4; i_216_++) {
			for (int i_217_ = 0; i_217_ < 64; i_217_++) {
				for (int i_218_ = 0; i_218_ < 64; i_218_++) {
					if (i_214_ + i_217_ > 0 && i_214_ + i_217_ < 103 && i + i_218_ > 0
						&& i + i_218_ < 103) {
						class46s[i_216_].anIntArrayArray757[i_214_ + i_217_][i + i_218_] &= ~0x1000000;
					}
				}
			}
		}
		Packet packet = new Packet(is);
		for (int i_219_ = 0; i_219_ < 4; i_219_++) {
			for (int i_220_ = 0; i_220_ < 64; i_220_++) {
				for (int i_221_ = 0; i_221_ < 64; i_221_++) {
					method183(i_215_, (byte) -61, i_213_, packet, 0, i_220_ + i_214_,
						i_219_, i_221_ + i);
				}
			}
		}
	}

	public Class8(int[][][] is, int i, byte[][][] is_222_, int i_223_, int i_224_) {
		Class8.anInt150 = 99;
		anInt151 = i_224_;
		anInt152 = i_223_;
		anIntArrayArrayArray149 = is;
		aByteArrayArrayArray138 = is_222_;
		aByteArrayArrayArray159 = new byte[4][anInt151][anInt152];
		aByteArrayArrayArray155 = new byte[4][anInt151][anInt152];
		aByteArrayArrayArray153 = new byte[4][anInt151][anInt152];
		aByteArrayArrayArray142 = new byte[4][anInt151][anInt152];
		anIntArrayArrayArray168 = new int[4][anInt151 + 1][anInt152 + 1];
		aByteArrayArrayArray164 = new byte[4][anInt151 + 1][anInt152 + 1];
		anIntArrayArray165 = new int[anInt151 + 1][anInt152 + 1];
		anIntArray144 = new int[anInt152];
		anIntArray145 = new int[anInt152];
		anIntArray146 = new int[anInt152];
		anIntArray147 = new int[anInt152];
		anIntArray148 = new int[anInt152];
		if (i != 14290) {
			throw new NullPointerException();
		}
	}

	private static final int method175(int i, int i_225_) {
		int i_226_ = i + i_225_ * 57;
		i_226_ = i_226_ << 13 ^ i_226_;
		int i_227_ = (i_226_ * (i_226_ * i_226_ * 15731 + 789221) + 1376312589 & 0x7fffffff);
		return i_227_ >> 19 & 0xff;
	}

	private static final int method176(int i, int i_228_, int i_229_, int i_230_) {
		int i_231_ = (65536 - (Renderer3D.anIntArray1537[i_229_ * 1024 / i_230_]) >> 1);
		return (i * (65536 - i_231_) >> 16) + (i_228_ * i_231_ >> 16);
	}

	private final int method177(int i, int i_232_, int i_233_) {
		if (i_233_ > 179) {
			i_232_ /= 2;
		}
		if (i_233_ > 192) {
			i_232_ /= 2;
		}
		if (i_233_ > 217) {
			i_232_ /= 2;
		}
		if (i_233_ > 243) {
			i_232_ /= 2;
		}
		int i_234_ = (i / 4 << 10) + (i_232_ / 32 << 7) + i_233_ / 2;
		return i_234_;
	}

	private static final int method178(int i, int i_235_) {
		int i_236_ = (Class8.method175(i - 1, i_235_ - 1) + Class8.method175(i + 1, i_235_ - 1)
			+ Class8.method175(i - 1, i_235_ + 1) + Class8.method175(i + 1, i_235_ + 1));
		int i_237_ = (Class8.method175(i - 1, i_235_) + Class8.method175(i + 1, i_235_)
			+ Class8.method175(i, i_235_ - 1) + Class8.method175(i, i_235_ + 1));
		int i_238_ = Class8.method175(i, i_235_);
		return i_236_ / 16 + i_237_ / 8 + i_238_ / 4;
	}

	public final void method179(int i, CollisionMap[] class46s, int i_239_, int i_240_, Class22 class22,
		byte[] is) {
		if (i_240_ < 0) {
			Packet packet = new Packet(is);
			int i_241_ = -1;
			for (;;) {
				int i_242_ = packet.getSmart();
				if (i_242_ == 0) {
					break;
				}
				i_241_ += i_242_;
				int i_243_ = 0;
				for (;;) {
					int i_244_ = packet.getSmart();
					if (i_244_ == 0) {
						break;
					}
					i_243_ += i_244_ - 1;
					int i_245_ = i_243_ & 0x3f;
					int i_246_ = i_243_ >> 6 & 0x3f;
					int i_247_ = i_243_ >> 12;
					int i_248_ = packet.getUByte();
					int i_249_ = i_248_ >> 2;
					int i_250_ = i_248_ & 0x3;
					int i_251_ = i_246_ + i_239_;
					int i_252_ = i_245_ + i;
					if (i_251_ > 0 && i_252_ > 0 && i_251_ < 103 && i_252_ < 103) {
						int i_253_ = i_247_;
						if ((aByteArrayArrayArray138[1][i_251_][i_252_] & 0x2) == 2) {
							i_253_--;
						}
						CollisionMap collisionMap = null;
						if (i_253_ >= 0) {
							collisionMap = class46s[i_253_];
						}
						method173(class22, collisionMap, i_252_, i_247_, i_251_, aByte139, i_250_,
							i_249_, i_241_);
					}
				}
			}
		}
	}

	public final void method180(int i, int i_254_, int i_255_, int i_256_, int i_257_) {
		if (i_256_ < 0) {
			for (int i_258_ = i_254_; i_258_ <= i_254_ + i_255_; i_258_++) {
				for (int i_259_ = i; i_259_ <= i + i_257_; i_259_++) {
					if (i_259_ >= 0 && i_259_ < anInt151 && i_258_ >= 0 && i_258_ < anInt152) {
						aByteArrayArrayArray164[0][i_259_][i_258_] = (byte) 127;
						if (i_259_ == i && i_259_ > 0) {
							anIntArrayArrayArray149[0][i_259_][i_258_] = (anIntArrayArrayArray149[0][i_259_ - 1][i_258_]);
						}
						if (i_259_ == i + i_257_ && i_259_ < anInt151 - 1) {
							anIntArrayArrayArray149[0][i_259_][i_258_] = (anIntArrayArrayArray149[0][i_259_ + 1][i_258_]);
						}
						if (i_258_ == i_254_ && i_258_ > 0) {
							anIntArrayArrayArray149[0][i_259_][i_258_] = (anIntArrayArrayArray149[0][i_259_][i_258_ - 1]);
						}
						if (i_258_ == i_254_ + i_255_ && i_258_ < anInt152 - 1) {
							anIntArrayArrayArray149[0][i_259_][i_258_] = (anIntArrayArrayArray149[0][i_259_][i_258_ + 1]);
						}
					}
				}
			}
		}
	}

	public static final boolean method181(int i, int i_260_, byte[] is, int i_261_) {
		boolean bool = true;
		Packet packet = new Packet(is);
		if (i_261_ != 24515) {
			throw new NullPointerException();
		}
		int i_262_ = -1;
		for (;;) {
			int i_263_ = packet.getSmart();
			if (i_263_ == 0) {
				break;
			}
			i_262_ += i_263_;
			int i_264_ = 0;
			boolean bool_265_ = false;
			for (;;) {
				if (bool_265_) {
					int i_266_ = packet.getSmart();
					if (i_266_ == 0) {
						break;
					}
					packet.getUByte();
				} else {
					int i_267_ = packet.getSmart();
					if (i_267_ == 0) {
						break;
					}
					i_264_ += i_267_ - 1;
					int i_268_ = i_264_ & 0x3f;
					int i_269_ = i_264_ >> 6 & 0x3f;
					int i_270_ = packet.getUByte() >> 2;
					int i_271_ = i_269_ + i;
					int i_272_ = i_268_ + i_260_;
					if (i_271_ > 0 && i_272_ > 0 && i_271_ < 103 && i_272_ < 103) {
						ObjectDefinition objectDefinition = ObjectDefinition.method434(i_262_);
						if (i_270_ != 22 || !Class8.aBoolean169 || objectDefinition.aBoolean759
							|| objectDefinition.aBoolean765) {
							bool &= objectDefinition.method439();
							bool_265_ = true;
						}
					}
				}
			}
		}
		return bool;
	}

	private final int method182(int i, int i_273_) {
		if (i == -2) {
			return 12345678;
		}
		if (i == -1) {
			if (i_273_ < 0) {
				i_273_ = 0;
			} else if (i_273_ > 127) {
				i_273_ = 127;
			}
			i_273_ = 127 - i_273_;
			return i_273_;
		}
		i_273_ = i_273_ * (i & 0x7f) / 128;
		if (i_273_ < 2) {
			i_273_ = 2;
		} else if (i_273_ > 126) {
			i_273_ = 126;
		}
		return (i & 0xff80) + i_273_;
	}

	private final void method183(int i, byte i_274_, int i_275_,
		Packet packet, int i_276_, int i_277_, int i_278_, int i_279_) {
		if (i_274_ != -61) {
			aBoolean140 = !aBoolean140;
		}
		if (i_277_ >= 0 && i_277_ < 104 && i_279_ >= 0 && i_279_ < 104) {
			aByteArrayArrayArray138[i_278_][i_277_][i_279_] = (byte) 0;
			for (;;) {
				int i_280_ = packet.getUByte();
				if (i_280_ == 0) {
					if (i_278_ == 0) {
						anIntArrayArrayArray149[0][i_277_][i_279_] = -Class8.method184(i_277_
							+ 932731 + i, i_279_ + 556238 + i_275_) * 8;
					} else {
						anIntArrayArrayArray149[i_278_][i_277_][i_279_] = (anIntArrayArrayArray149[i_278_ - 1][i_277_][i_279_]) - 240;
						break;
					}
					break;
				}
				if (i_280_ == 1) {
					int i_281_ = packet.getUByte();
					if (i_281_ == 1) {
						i_281_ = 0;
					}
					if (i_278_ == 0) {
						anIntArrayArrayArray149[0][i_277_][i_279_] = -i_281_ * 8;
					} else {
						anIntArrayArrayArray149[i_278_][i_277_][i_279_] = (anIntArrayArrayArray149[i_278_ - 1][i_277_][i_279_])
							- i_281_ * 8;
						break;
					}
					break;
				}
				if (i_280_ <= 49) {
					aByteArrayArrayArray155[i_278_][i_277_][i_279_] = packet.getByte();
					aByteArrayArrayArray153[i_278_][i_277_][i_279_] = (byte) ((i_280_ - 2) / 4);
					aByteArrayArrayArray142[i_278_][i_277_][i_279_] = (byte) (i_280_ - 2 + i_276_ & 0x3);
				} else if (i_280_ <= 81) {
					aByteArrayArrayArray138[i_278_][i_277_][i_279_] = (byte) (i_280_ - 49);
				} else {
					aByteArrayArrayArray159[i_278_][i_277_][i_279_] = (byte) (i_280_ - 81);
				}
			}
		} else {
			for (;;) {
				int i_282_ = packet.getUByte();
				if (i_282_ == 0) {
					break;
				}
				if (i_282_ == 1) {
					packet.getUByte();
					break;
				}
				if (i_282_ <= 49) {
					packet.getUByte();
				}
			}
		}
	}

	private static final int method184(int i, int i_283_) {
		int i_284_ = (Class8.method163(i + 45365, i_283_ + 91923, 4) - 128
			+ (Class8.method163(i + 10294, i_283_ + 37821, 2) - 128 >> 1) + (Class8.method163(i,
			i_283_, 1) - 128 >> 2));
		i_284_ = (int) (i_284_ * 0.3) + 35;
		if (i_284_ < 10) {
			i_284_ = 10;
		} else if (i_284_ > 60) {
			i_284_ = 60;
		}
		return i_284_;
	}
}
